Optimal. Leaf size=48 \[ \frac {a \tan (c+d x)}{d}-\frac {a \cot (c+d x)}{d}+\frac {a \sec (c+d x)}{d}-\frac {a \tanh ^{-1}(\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2838, 2620, 14, 2622, 321, 207} \[ \frac {a \tan (c+d x)}{d}-\frac {a \cot (c+d x)}{d}+\frac {a \sec (c+d x)}{d}-\frac {a \tanh ^{-1}(\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 207
Rule 321
Rule 2620
Rule 2622
Rule 2838
Rubi steps
\begin {align*} \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x)) \, dx &=a \int \csc (c+d x) \sec ^2(c+d x) \, dx+a \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx\\ &=\frac {a \operatorname {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}+\frac {a \operatorname {Subst}\left (\int \frac {1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {a \sec (c+d x)}{d}+\frac {a \operatorname {Subst}\left (\int \left (1+\frac {1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac {a \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac {a \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a \cot (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.08, size = 68, normalized size = 1.42 \[ \frac {a \tan (c+d x)}{d}-\frac {a \cot (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}-\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.46, size = 165, normalized size = 3.44 \[ -\frac {4 \, a \cos \left (d x + c\right )^{2} + 2 \, a \cos \left (d x + c\right ) + {\left (a \cos \left (d x + c\right )^{2} + {\left (a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a \cos \left (d x + c\right )^{2} + {\left (a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, {\left (2 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - 2 \, a}{2 \, {\left (d \cos \left (d x + c\right )^{2} + {\left (d \cos \left (d x + c\right ) + d\right )} \sin \left (d x + c\right ) - d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.21, size = 87, normalized size = 1.81 \[ \frac {2 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 4 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.38, size = 69, normalized size = 1.44 \[ \frac {a}{d \cos \left (d x +c \right )}+\frac {a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {a}{d \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {2 a \cot \left (d x +c \right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 59, normalized size = 1.23 \[ \frac {a {\left (\frac {2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, a {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.97, size = 77, normalized size = 1.60 \[ \frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a-5\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________